package srzy.module

import srzy.dao.DBOracle

object DBRec extends AbsCaseDeal with srzy.common.Logging {

  val caseInfoSource = DBOracle

  def deal = {
    val c = caseInfoSource.executeLine("SELECT COUNT(*) FROM OCS_AUTO_CASE_OFFLINE WHERE CASE_PWD = '" + getCaseInfo.casePath + "'")
    if (c == "0") {
      caseInfoSource.executeUpdate("INSERT INTO OCS_AUTO_CASE_OFFLINE(CASE_PWD, DEAL_FLAG, DEAL_DATE) VALUES ('" + getCaseInfo.casePath + "', '0', SYSDATE)")
    }
    val flag = if (getCaseInfo.caseResult == false) 2 else 1
    caseInfoSource.executeUpdate("UPDATE OCS_AUTO_CASE_OFFLINE SET DEAL_FLAG = " + flag + " ,DEAL_DATE = SYSDATE WHERE CASE_PWD = '" + getCaseInfo.casePath + "'")

  }
}